{
  let $ = window.jQuery;

  class MyPlugin {
    constructor(element, options) {
      this.$element = $(element);
      this.options = $.extend({}, this.$element.data(), options);
    }

    run(option) {
      // your code
    }
  }

  $.fn.myplugin = function(options) {
    return this.each(function(){
      let plugin = new MyPlugin(this, options);
      plugin.run();
    });
  }

  $.fn.myplugin.Constructor = MyPlugin;

  $(document).ready(() => {
    $('[data-toggle="myplugin"]').myplugin();
  });
}
